import React from 'react'
import PropTypes from 'prop-types'
import styled from 'styled-components'

const ImageViewWrapper = styled.div`
  width: 100%;
  height: 100%;
  img {
    width: 100%;
    height: 100%;
    border-radius: ${props => props.round ? '50%' : ''}
  } 
`;

const ImageView = (props) => {
  const { src, round } = props;
  return (
    <ImageViewWrapper round={round}>
      <img src={src} alt='' />
    </ImageViewWrapper>
  )
}

ImageView.propTypes = {
  src: PropTypes.string,
  round: PropTypes.bool
}

export default ImageView;
